<include file="../Public/_top" />
<script src="__THEME__/js/Highcharts/highcharts.js"></script>
<script src="__THEME__/js/Highcharts/highcharts-more.js"></script>
<script src="__THEME__/js/Highcharts/modules/exporting.js"></script>
<script src="__THEME__/js/jqprint.js"></script>
<script language="javascript">
function print(){
  $("#con_wrap").jqprint();
}
</script>
<div class="content" style="width:100%;">
  <div style="float:right:width:10px;margin-right:200px;text-align: right;font-size:16px;">
    <input type="button" onclick="print();" value="打印"/>
  </div>
  <div class="wrap">
    <div class="con_wrap" id="con_wrap">
      <!--整体评分情况开始-->
      <style>
        .title{
          width:100%;
          height:100px;
          color:#e80115;
          font-size:28px;
          line-height:100px;
          text-align:center;
          font-family:"新宋体";
          font-weight:bold;
        }
        .banner{
          width:98.8%;
          height:36px;
          background-color:#67bd98;
          line-height:36px;
          padding-left:15px;
          color:#fff;
          font-size:18px;
        }
       .table{
          border:1px solid #eeeeee;
          text-align:center;
          font-size:14px;
          font-weight:bold;
        }
        .triangle-right{
          width: 0;
          height: 0;
          border-top: 5px solid transparent;
          border-left: 10px solid #67bd98;
          border-bottom: 5px solid transparent;
        }
        .r_l_b_text{
          margin:0px 3px 3px 0px;
          float:left;
          width:24.5%;
          height:40px;
          background-color:#e6e3f7;
          text-align:center;
          padding-top:15px;
          font-size:16px;
        }
        </style>
        <div class="title">{$data.rpt_name}</div>
        <div class="banner">本班共有{$data.count}人参与测试</div>
        <div class="con_tit">体质达标</div>
        <div id="quality" style="margin: auto auto 50px auto;width:620px;"></div>
        <script>
            var sum1=parseFloat("<?php echo $data['sum'][0]; ?>");
            var sum2=parseFloat("<?php echo $data['sum'][1]; ?>");
            var sum3=parseFloat("<?php echo $data['sum'][2]; ?>");
            var sum4=parseFloat("<?php echo $data['sum'][3]; ?>");
            var sum5=parseFloat("<?php echo $data['sum'][4]; ?>");
            $('#quality').highcharts({
            exporting: {
              enabled:false
            },

              chart: {
                  plotBackgroundColor: null,
                  plotBorderWidth: null,
                  plotShadow: false,
                  type: 'pie'
              },
              title: {
                  text: '体质达标情况（人）'
              },
              plotOptions: {
                pie: {
                  allowPointSelect: true,
                  cursor: 'pointer',
                  dataLabels: {
                      enabled: false
                  },
                  showInLegend: true
                }
              },
              series: [{
                name: '体质',
                colorByPoint: true,
                data: [{
                  name: '无法评级',
                  y: sum5
                },{
                  name: '不合格',
                  y: sum1
                }, {
                  name: '合格',
                  y: sum2
                }, {
                  name: '良好',
                  y: sum3
                }, {
                  name: '优秀',
                  y: sum4
                }]
              }]
            });
          </script>
        <div style="padding-left: 240px;margin-bottom:50px;">
          <table class="table" border="1"  style="width:620px;border:1px solid #67bd98;">
            <tr>
              <td height="30" style="text-align:center;">无法评级</td>
              <td height="30" style="text-align:center;">不合格</td>
              <td style="text-align:center;">合格</td>
              <td style="text-align:center;">良好</td>
              <td style="text-align:center;">优秀</td>
            </tr>
            <tr>
              <td style="text-align:center;">{$data['sum'][4]} 人</td>
              <td style="text-align:center;">{$data['sum'][0]} 人</td>
              <td style="text-align:center;">{$data['sum'][1]} 人</td>
              <td style="text-align:center;">{$data['sum'][2]} 人</td>
              <td style="text-align:center;">{$data['sum'][3]} 人</td>
            </tr>
          </table>
        </div>

        <div class="con_tit">身高达标</div>
        <div id="height" style="margin: auto auto 50px auto;width:620px;"></div>
        <script>
            var height1=parseFloat("<?php echo $data['height'][0]; ?>");
            var height2=parseFloat("<?php echo $data['height'][1]; ?>");
            var height3=parseFloat("<?php echo $data['height'][2]; ?>");
            var height4=parseFloat("<?php echo $data['height'][3]; ?>");
            var height5=parseFloat("<?php echo $data['height'][4]; ?>");
            $('#height').highcharts({
            exporting: {
              enabled:false
            },

               chart: {
                  type: 'column'
              },
              title: {
                  text: '身高达标情况'
              },
              subtitle: {
                  text: ''
              },
              xAxis: {
                  categories: [
                      '很矮',
                      '较矮',
                      '正常',
                      '较高',
                      '很高'
                  ],
                  crosshair: true
              },
              yAxis: {
                  min: 0,
                  title: {
                    text: '人 (个)'
                  }
              },
              tooltip: {
                  headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                  pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                      '<td style="padding:0"><b>{point.y}个</b></td></tr>',
                  footerFormat: '</table>',
                  shared: true,
                  useHTML: true
              },
              plotOptions: {
                  column: {
                      pointPadding: 0.2,
                      borderWidth: 0
                  }
              },
              series: [{
                  name: '人数',
                  data: [height1, height2, height3, height4, height5]

              }]
            });
          </script>
        <div style="padding-left: 240px;margin-bottom:50px;">
          <table class="table" border="1"  style="width:620px;border:1px solid #67bd98;">
            <tr>
              <td height="30" style="text-align:center;">很矮</td>
              <td style="text-align:center;">较矮</td>
              <td style="text-align:center;">正常</td>
              <td style="text-align:center;">偏高</td>
              <td style="text-align:center;">很高</td>
            </tr>
            <tr>
              <td style="text-align:center;">{$data['height'][0]} 人</td>
              <td style="text-align:center;">{$data['height'][1]} 人</td>
              <td style="text-align:center;">{$data['height'][2]} 人</td>
              <td style="text-align:center;">{$data['height'][3]} 人</td>
              <td style="text-align:center;">{$data['height'][4]} 人</td>
            </tr>
          </table>
        </div>

        <div class="con_tit">体重达标</div>
        <div id="weight" style="margin: auto auto 50px auto;width:620px;"></div>
        <script>
          var weight1=parseFloat("<?php echo $data['weight'][0]; ?>");
          var weight2=parseFloat("<?php echo $data['weight'][1]; ?>");
          var weight3=parseFloat("<?php echo $data['weight'][2]; ?>");
          var weight4=parseFloat("<?php echo $data['weight'][3]; ?>");
          var weight5=parseFloat("<?php echo $data['weight'][4]; ?>");
          $('#weight').highcharts({
            exporting: {
              enabled:false
            },

             chart: {
                type: 'column'
            },
            title: {
                text: '体重达标情况'
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                categories: [
                    '很瘦',
                    '较瘦',
                    '正常',
                    '较胖',
                    '很胖'
                ],
                crosshair: true
            },
            yAxis: {
                min: 0,
                title: {
                  text: '人 (个)'
                }
            },
            tooltip: {
                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>{point.y}个</b></td></tr>',
                footerFormat: '</table>',
                shared: true,
                useHTML: true
            },
            plotOptions: {
                column: {
                    pointPadding: 0.2,
                    borderWidth: 0
                }
            },
            series: [{
                name: '人数',
                data: [weight1, weight2, weight3, weight4, weight5]

            }]
          });
        </script>
        <div style="padding-left: 240px;margin-bottom:50px;">
          <table class="table" border="1"  style="width:620px;border:1px solid #67bd98;">
            <tr>
              <td height="30" style="text-align:center;">很瘦</td>
              <td style="text-align:center;">较瘦</td>
              <td style="text-align:center;">正常</td>
              <td style="text-align:center;">偏胖</td>
              <td style="text-align:center;">很胖</td>
            </tr>
            <tr>
              <td style="text-align:center;">{$data['weight'][0]} 人</td>
              <td style="text-align:center;">{$data['weight'][1]} 人</td>
              <td style="text-align:center;">{$data['weight'][2]} 人</td>
              <td style="text-align:center;">{$data['weight'][3]} 人</td>
              <td style="text-align:center;">{$data['weight'][4]} 人</td>
            </tr>
          </table>
        </div>

        <div class="con_tit">身体素质</div>
        <div id="body_quality" style="margin: auto auto 50px auto;width:620px;"></div>
        <script>
          var reentry_run1=parseFloat("<?php echo $data['reentry_run'][0]; ?>");
          var reentry_run2=parseFloat("<?php echo $data['reentry_run'][1]; ?>");
          var reentry_run3=parseFloat("<?php echo $data['reentry_run'][2]; ?>");
          var reentry_run4=parseFloat("<?php echo $data['reentry_run'][3]; ?>");
          var reentry_run5=parseFloat("<?php echo $data['reentry_run'][4]; ?>");
          var standing_long_jump1=parseFloat("<?php echo $data['standing_long_jump'][0]; ?>");
          var standing_long_jump2=parseFloat("<?php echo $data['standing_long_jump'][1]; ?>");
          var standing_long_jump3=parseFloat("<?php echo $data['standing_long_jump'][2]; ?>");
          var standing_long_jump4=parseFloat("<?php echo $data['standing_long_jump'][3]; ?>");
          var standing_long_jump5=parseFloat("<?php echo $data['standing_long_jump'][4]; ?>");
          var tennis_throw1=parseFloat("<?php echo $data['tennis_throw'][0]; ?>");
          var tennis_throw2=parseFloat("<?php echo $data['tennis_throw'][1]; ?>");
          var tennis_throw3=parseFloat("<?php echo $data['tennis_throw'][2]; ?>");
          var tennis_throw4=parseFloat("<?php echo $data['tennis_throw'][3]; ?>");
          var tennis_throw5=parseFloat("<?php echo $data['tennis_throw'][4]; ?>");
          var continuousJump1=parseFloat("<?php echo $data['continuousJump'][0]; ?>");
          var continuousJump2=parseFloat("<?php echo $data['continuousJump'][1]; ?>");
          var continuousJump3=parseFloat("<?php echo $data['continuousJump'][2]; ?>");
          var continuousJump4=parseFloat("<?php echo $data['continuousJump'][3]; ?>");
          var continuousJump5=parseFloat("<?php echo $data['continuousJump'][4]; ?>");
          var flexion1=parseFloat("<?php echo $data['flexion'][0]; ?>");
          var flexion2=parseFloat("<?php echo $data['flexion'][1]; ?>");
          var flexion3=parseFloat("<?php echo $data['flexion'][2]; ?>");
          var flexion4=parseFloat("<?php echo $data['flexion'][3]; ?>");
          var flexion5=parseFloat("<?php echo $data['flexion'][4]; ?>");
          var balanceBeam1=parseFloat("<?php echo $data['balanceBeam'][0]; ?>");
          var balanceBeam2=parseFloat("<?php echo $data['balanceBeam'][1]; ?>");
          var balanceBeam3=parseFloat("<?php echo $data['balanceBeam'][2]; ?>");
          var balanceBeam4=parseFloat("<?php echo $data['balanceBeam'][3]; ?>");
          var balanceBeam5=parseFloat("<?php echo $data['balanceBeam'][4]; ?>");
          $('#body_quality').highcharts({
            exporting: {
              enabled:false
            },

            chart: {
                type: 'bar'
            },
            title: {
                text: '身体素质环比'
            },
            xAxis: {
              categories: ['灵敏协调', '平衡能力', '上肢力量', '下肢力量',
                        '速度素质', '柔韧素质'],
            },
            yAxis: {
                min: 0,
                title: {
                    text: ''
                }
            },
            legend: {
                reversed: true
            },
            plotOptions: {
                series: {
                    stacking: 'normal'
                }
            },
            series: [{
                name: '很差',
                data: [continuousJump1,balanceBeam1,tennis_throw1,standing_long_jump1,reentry_run1,flexion1]
            },{
                name: '较差',
                data: [continuousJump2,balanceBeam2,tennis_throw2,standing_long_jump2,reentry_run2,flexion2]
            },{
                name: '正常',
                data: [continuousJump3,balanceBeam3,tennis_throw3,standing_long_jump3,reentry_run3,flexion3]
            },{
                name: '良好',
                data: [continuousJump4,balanceBeam4,tennis_throw4,standing_long_jump4,reentry_run4,flexion4]
            },{
                name: '优秀',
                data: [continuousJump5,balanceBeam5,tennis_throw5,standing_long_jump5,reentry_run5,flexion5]
            }]
          });
        </script>

        <div class="con_tit">身体机能</div>
        <div id="Heart_rate" style="margin: auto auto 50px auto;width:620px;"></div>
        <script>
          var Heart_rate1=parseFloat("<?php echo $data['Heart_rate'][0]; ?>");
        var Heart_rate2=parseFloat("<?php echo $data['Heart_rate'][1]; ?>");
        var Heart_rate3=parseFloat("<?php echo $data['Heart_rate'][2]; ?>");
        $('#Heart_rate').highcharts({
            exporting: {
              enabled:false
            },

          chart: {
              plotBackgroundColor: null,
              plotBorderWidth: null,
              plotShadow: false,
              type: 'pie'
          },
          title: {
              text: '身体机能达标情况（人）'
          },
          plotOptions: {
            pie: {
              allowPointSelect: true,
              cursor: 'pointer',
              dataLabels: {
                  enabled: false
              },
              showInLegend: true
            }
          },
          series: [{
            name: '心率',
            colorByPoint: true,
            data: [{
              name: '慢',
              y: Heart_rate1
            }, {
              name: '标准',
              y: Heart_rate2
            }, {
              name: '快',
              y: Heart_rate3
            }]
          }]
        });
        </script>
        <div style="padding-left: 240px;margin-bottom:50px;">
          <table class="table" border="1"  style="width:620px;border:1px solid #67bd98;">
            <tr>
              <td height="30" style="text-align:center;">慢</td>
              <td style="text-align:center;">标准</td>
              <td style="text-align:center;">快</td>
            </tr>
            <tr>
              <td style="text-align:center;">{$data['Heart_rate'][0]} 人</td>
              <td style="text-align:center;">{$data['Heart_rate'][1]} 人</td>
              <td style="text-align:center;">{$data['Heart_rate'][2]} 人</td>
            </tr>
          </table>
        </div>

        <div class="con_tit">测试结果列表</div>
        <div class="con_box">
            <ul style="width:100%;">
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">姓名</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">性别</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国民体质评分</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国标等级</li>
            </ul>
            <ul style="width:100%;" id="user_list"></ul>
        </div>

        <div class="con_tit">肥胖儿列表</div>
        <div class="con_box">
          <ul style="width:100%;">
            <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">姓名</li>
            <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">性别</li>
            <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国民体质评分</li>
            <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国标等级</li>
          </ul>
          <ul style="width:100%;" id="userList"></ul>
        </div>
        <div class="con_tit">无法评级列表</div>
        <div class="con_box">
            <ul style="width:100%;">
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">姓名</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">性别</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国民体质评分</li>
              <li class="r_l_b_text" style="background-color:#d2cde5;color:#b991c4;">国标等级</li>
            </ul>
            <ul style="width:100%;" id="unable_ratings_list"></ul>
        </div>

    </div>
  </div>
</div>
<script>
var rpt_id="<?php echo $data['rpt_id'];?>";
  $(document).ready(function(){
    $.ajax({
      type: "GET",
      url:"{:U('public/Report/getReportList')}",
      data:"rpt_id="+rpt_id,
      dataType:"json",
      success:function(data){
        $.each(data,function(i,item){
          $("#user_list").append("<li class='r_l_b_text'> <a href='"+item.url+"'>"+item.name+"</a></li><li class='r_l_b_text'>"+item.gender+"</li><li class='r_l_b_text'>"+item.score+"</li><li class='r_l_b_text'>"+item.result+"</li>");
        });
      }
    });
    $.ajax({
      type: "GET",
      url:"{:U('public/Report/getReportList')}",
      data:"is_obesity=1&rpt_id="+rpt_id,
      dataType:"json",
      success:function(data){
        $.each(data,function(i,item){
          $("#userList").append("<li class='r_l_b_text'> <a href='"+item.url+"'>"+item.name+"</a></li><li class='r_l_b_text'>"+item.gender+"</li><li class='r_l_b_text'>"+item.score+"</li><li class='r_l_b_text'>"+item.result+"</li>");
        }); 
      }
    });
    $.ajax({
      type: "GET",
      url:"{:U('public/Report/getReportList')}",
      data:"is_unable_ratings=1&rpt_id="+rpt_id,
      dataType:"json",
      success:function(data){
        $.each(data,function(i,item){
          $("#unable_ratings_list").append("<li class='r_l_b_text'> <a href='"+item.url+"'>"+item.name+"</a></li><li class='r_l_b_text'>"+item.gender+"</li><li class='r_l_b_text'>"+item.score+"</li><li class='r_l_b_text'>"+item.result+"</li>");
        }); 
      }
    });
  }); 
</script>
<include file="../Public/_foot" />